package com.redsoil.house.ui.remit.adapter;

import android.text.Html;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.redsoil.house.R;
import com.redsoil.house.app.AppContext;
import com.redsoil.house.base.BaseViewHolderTSK;
import com.redsoil.house.model.bean.ReceiptListVO;
import com.redsoil.house.model.bean.TestVO;

import java.util.List;

/**
 * 作者：weidingqiang on 2018/12/23 19:38
 * 邮箱：weidingqiang@163.com
 */

public class RemitAdapter extends BaseQuickAdapter<ReceiptListVO.DataListBean,BaseViewHolderTSK> {

    public RemitAdapter(int layoutResId, List<ReceiptListVO.DataListBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolderTSK helper, ReceiptListVO.DataListBean item) {

        helper.setText(R.id.payment_time_tv,item.getPaymentTime());

        helper.setText(R.id.profit_time_tv,item.getProfitInterval());

        String str;
        if(AppContext.getInstance().getCurrentMoneyType().equals("JPY")){
            str=item.getMoney();
        }else {
            str=item.getMoney()+"<br/><font color='#999999'>("+AppContext.getInstance().getCurrentMoneyType()+item.getTargetMoney()+")</font>";
        }

        helper.setText(R.id.money_tv, Html.fromHtml(str));

        //已汇款：1，未汇款：2
        switch (item.getStatus()){
            case 1:
                helper.setText(R.id.state_tv,"已汇");
                break;
            case 2:
                helper.setText(R.id.state_tv,"未汇款");
                break;
        }
    }
}
